package com.esri.core.geometry;

import com.github.mikephil.charting.utils.Utils;

/* loaded from: classes.dex */
class VertexDescription {
    static double[] e = {Utils.DOUBLE_EPSILON, Utils.DOUBLE_EPSILON, NumberUtils.NaN(), Utils.DOUBLE_EPSILON, Utils.DOUBLE_EPSILON, Utils.DOUBLE_EPSILON, Utils.DOUBLE_EPSILON, Utils.DOUBLE_EPSILON, Utils.DOUBLE_EPSILON};
    static int[] f = {1, 1, 1, 0, 2, 1, 1, 1, 0};
    static int[] g = {1, 1, 1, 2, 0, 0, 0, 0, 2};
    static int[] h = {4, 8, 4, 8, 1, 2};
    static int[] i = {2, 1, 1, 1, 3, 1, 2, 3, 2};
    int a;
    int[] b;
    int[] c;
    int d;
    private double[] j;
    private int[] k;

    /* loaded from: classes.dex */
    interface Interpolation {
        public static final int ANGULAR = 2;
        public static final int LINEAR = 1;
        public static final int NONE = 0;
    }

    /* loaded from: classes.dex */
    interface Persistence {
        public static final int enumDouble = 1;
        public static final int enumFloat = 0;
        public static final int enumInt16 = 5;
        public static final int enumInt32 = 2;
        public static final int enumInt64 = 3;
        public static final int enumInt8 = 4;
    }

    /* loaded from: classes.dex */
    public interface Semantics {
        public static final int ID = 3;
        public static final int ID2 = 8;
        public static final int M = 2;
        public static final int MAXSEMANTICS = 10;
        public static final int NORMAL = 4;
        public static final int POSITION = 0;
        public static final int TEXTURE1D = 5;
        public static final int TEXTURE2D = 6;
        public static final int TEXTURE3D = 7;
        public static final int Z = 1;
    }

    public static boolean isIntegerPersistence(int i2) {
        return i2 < 2;
    }

    public boolean equals(Object obj) {
        return this == obj;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public VertexDescription() {
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public VertexDescription(int i2, VertexDescription vertexDescription) {
        this.a = vertexDescription.a;
        this.b = (int[]) vertexDescription.b.clone();
        this.c = (int[]) vertexDescription.c.clone();
        this.d = vertexDescription.d;
        this.k = new int[getAttributeCount()];
        int i3 = 0;
        for (int i4 = 0; i4 < getAttributeCount(); i4++) {
            this.k[i4] = i3;
            i3 += getComponentCount(this.b[i4]);
        }
        this.j = new double[i3];
        for (int i5 = 0; i5 < getAttributeCount(); i5++) {
            int componentCount = getComponentCount(getSemantics(i5));
            double defaultValue = getDefaultValue(getSemantics(i5));
            for (int i6 = 0; i6 < componentCount; i6++) {
                this.j[this.k[i5] + i6] = defaultValue;
            }
        }
    }

    public final int getAttributeCount() {
        return this.a;
    }

    public final int getSemantics(int i2) {
        if (i2 < 0 || i2 > this.a) {
            throw new IllegalArgumentException();
        }
        return this.b[i2];
    }

    public final int getAttributeIndex(int i2) {
        return this.c[i2];
    }

    public static int getInterpolation(int i2) {
        return f[i2];
    }

    public static int getPersistence(int i2) {
        return g[i2];
    }

    public static int getPersistenceSize(int i2) {
        return h[i2];
    }

    public static int getPersistenceSizeSemantics(int i2) {
        return getPersistenceSize(getPersistence(i2)) * getComponentCount(i2);
    }

    public static int getComponentCount(int i2) {
        return i[i2];
    }

    public static boolean isIntegerSemantics(int i2) {
        return isIntegerPersistence(getPersistence(i2));
    }

    public boolean hasAttribute(int i2) {
        return this.c[i2] >= 0;
    }

    public boolean hasZ() {
        return hasAttribute(1);
    }

    public boolean hasM() {
        return hasAttribute(2);
    }

    public boolean hasID() {
        return hasAttribute(3);
    }

    public static double getDefaultValue(int i2) {
        return e[i2];
    }

    public static boolean isDefaultValue(int i2, double d) {
        return NumberUtils.doubleToInt64Bits(e[i2]) == NumberUtils.doubleToInt64Bits(d);
    }

    public static int getPersistenceFromInt(int i2) {
        if (i2 == 4) {
            return 2;
        }
        if (i2 == 8) {
            return 3;
        }
        throw new IllegalArgumentException();
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public int a() {
        int hash = NumberUtils.hash(this.b[0]);
        for (int i2 = 1; i2 < this.a; i2++) {
            hash = NumberUtils.hash(hash, this.b[i2]);
        }
        return hash;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public double[] b() {
        return this.j;
    }

    double a(int i2, int i3) {
        return this.j[a(i2) + i3];
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public int a(int i2) {
        return this.k[i2];
    }

    int b(int i2) {
        return this.k[getAttributeIndex(i2)];
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public int c() {
        return this.j.length;
    }

    public int hashCode() {
        return this.d;
    }

    public int _getSemanticsImpl(int i2) {
        return this.b[i2];
    }
}
